<% include_stylesheet 'admin/extensions/assets/assets' %>

<h1>Remove Asset</h1>
<p> 
  Are you sure you want to <strong class="warning">permanently remove</strong>
  the following asset?
</p>

<table class="index" id="assets">
  <tr><td class="name"><%= asset_listing(@asset) %></td></tr>
  <% if @asset.page_attachments.any? %>
    <tr>
      <th>
        It's being used on the following
        <%= pluralize(@asset.page_attachments.size, 'page') %> and will be removed from
        there as well:
        </th>
    </tr>
    <% @asset.page_attachments.each do |attachment| %>
      <tr><td><%= attachment.parent.title %></td></tr>
    <% end %>
  <% end %>
</table>

<% form_for [:admin, @asset], :html => {:method => :delete, 'data-onsubmit_status'=>'Removing asset&#8230;'} do |f| %>
  <p class="buttons">
    <%= f.submit 'Delete asset', :class=>'button' %>
    or <%= link_to 'Cancel', admin_assets_path %>
  </p>
<% end %>
